import modal

app = modal.App("resource-app")

# 请求 8 个 vCPU 和 16GB 内存
@app.function(cpu=8, memory=16384)
def high_memory_task():
    print("Running with high memory and CPU allocation.")
    import psutil
    print(f"CPU count: {psutil.cpu_count()}")
    print(f"Memory: {psutil.virtual_memory().total / (1024**3):.1f} GB")

@app.local_entrypoint()
def main():
    high_memory_task.remote()